﻿using System;
using System.Collections.Generic;

namespace KstopaCommon
{
    [Serializable]
    public class MotorPath
    {
        public GPoint StartPoint { get; set; }

        public GPoint EndPoint { get; set; }

        public List<MotorCurve> Curves = new List<MotorCurve>();

        public double SaftyHeight { get; set; }

        public double PTPHeight { get; set; }

        public double DispenserHeight { get; set; }

        public double PTPSpeed { get; set; }

        public double AccDecSpeed { get; set; }

        public double PTPAccDecSpeed { get; set; }

    }

    [Serializable]
    public class MotorCurve
    {
        public Shape Shape { get; set; }

        public double DispenserSpeed;

    }

    [Serializable]
    public class MotorCurPoint : MotorCurve
    {
        public GPoint mPoint;

        public int Delay;

        public MotorCurPoint()
        {
            Shape = Shape.Point;
        }
    }

    [Serializable]
    public class MotorCurLine : MotorCurve
    {
        public GPoint mFrontPoint;

        public GPoint mNextPoint;

        public MotorCurLine()
        {
            Shape = Shape.Line;
        }
    }

    [Serializable]
    public class MotorCurArc : MotorCurve
    {
        public GPoint mCenterPoint;

        public GPoint mFrontPoint;

        public GPoint mNextPoint;

        public double mRad;//RAD

        public double mRadius;

        public MotorCurArc()
        {
            Shape = Shape.Arc;
        }
    }

    [Serializable]
    public struct GPoint
    {
        public double X { get; set; }

        public double Y { get; set; }

        public GPoint(double x, double y)
        {
            X = x;
            Y = y;
        }

    }

    [Serializable]
    public enum Shape
    {
        Point = 0,
        Line = 1,
        Arc = 2
    }

    //画曲线模型
    //[Serializable]
    //public class Curve
    //{
    //    public Curve front = null;

    //    public Curve next = null;

    //    public Shape shape { get; set; }

    //    public double DispenserSpeed;

    //    public double PtpHeight;

    //    public double DispenserHeight;

    //}

    //[Serializable]
    //public class CurPoint : Curve
    //{
    //    public PointF gPoint;

    //    public int WaitTime;

    //    public CurPoint()
    //    {
    //        shape = Shape.Point;
    //    }

    //}

    //[Serializable]
    //public class CurLine : Curve
    //{
    //    public PointF gFrontPoint;

    //    public PointF gNextPoint;

    //    public double Slope;

    //    public CurLine()
    //    {
    //        shape = Shape.Line;
    //    }
    //}

    //[Serializable]
    //public class CurArc : Curve
    //{
    //    public PointF gCenterPoint;

    //    public PointF gFrontPoint;

    //    public PointF gNextPoint;

    //    public PointF gMiddlePoint;

    //    public double gRad;//RAD

    //    public double gRadius;

    //    public CurArc()
    //    {
    //        shape = Shape.Arc;
    //    }
    //}

}
